package br.com.ss.portal.controller.responsavel;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import br.com.ss.portal.model.dao.IResponsavelDAO;
import br.com.ss.portal.model.entity.Responsavel;

@Service
@Transactional
public class ResponsavelService implements IResponsavelService {

	@Autowired
	private IResponsavelDAO iResponsavelDAO;

	@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
	public void salvar(Responsavel responsavel) {
		iResponsavelDAO.save(responsavel);
	}

	@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
	public void deletar(Responsavel responsavel) {
		iResponsavelDAO.delete(responsavel);
	}

	public List<Responsavel> Buscartodos() {
		return iResponsavelDAO.getALL();
	}

}
